<template>
    <div class="app-container">
        <!-- 基础信息 -->
        <h5 class="titleInfo">
            基础信息
        </h5>
        <el-form ref="list1" :inline="true" :model="list1" label-width="130px">
            <el-row>
                <el-col :span="12">
                    <el-form-item label="会员手机号">
                        <span class="spanToInput">{{list1.username | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="昵称">
                        <span class="spanToInput">{{list1.nickName | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="会员姓名">
                        <span class="spanToInput">{{list1.realname | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="性别">
                        <span class="spanToInput">{{list1.sex | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="地区">
                        <span class="spanToInput">
                            {{list1.provinceName| filterNull}}
                            {{list1.cityName | filterNull}}
                            {{list1.areaName | filterNull}}
                        </span>
                    </el-form-item>
                </el-col>
            </el-row>
        </el-form>
        <!-- 推荐人信息 -->
        <div class="divBar"></div>
        <h5 class="titleInfo">
            推荐人信息
        </h5>
        <el-form ref="list1" :inline="true" :model="list1" label-width="130px">
            <el-row>
                <el-col :span="12">
                    <el-form-item label="推荐人姓名">
                        <span class="spanToInput">{{list1.refereeName | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="推荐人手机号">
                        <span class="spanToInput">{{list1.referee | filterNull}}</span>
                    </el-form-item>
                </el-col>
            </el-row>
        </el-form>
        <!-- 实名认证信息 -->
        <div class="divBar"></div>
        <h5 class="titleInfo">
            实名认证信息
        </h5>
        <el-form ref="list1" :inline="true" :model="list1" label-width="130px">
            <el-row>
                <el-col :span="12">
                    <el-form-item label="证件类型">
                        <span class="spanToInput">{{list1.identityType | cardNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="证件号码">
                        <span class="spanToInput">{{list1.identity}}</span>
                    </el-form-item>
                </el-col>
            </el-row>
        </el-form>
        <!-- 银行卡信息 -->
        <div class="divBar"></div>
        <h5 class="titleInfo">
            银行卡信息
        </h5>
        <el-form :inline="true" label-width="130px">
            <el-row v-for="(val,index) in list2" :key="index">
                <el-col :span="12">
                    <el-form-item label="开户行">
                        <span class="spanToInput">{{val.bankName | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="银行卡号">
                        <span class="spanToInput">{{val.cardNumber | filterNull}}</span>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row  v-if="list2.length==0">
                <el-col :span="12">
                    <el-form-item label="开户行">
                        <span class="spanToInput">暂无</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="银行卡号">
                        <span class="spanToInput">暂无</span>
                    </el-form-item>
                </el-col>
            </el-row>
        </el-form>
        <!-- 其他信息 -->
        <div class="divBar"></div>
        <h5 class="titleInfo">
            其他信息
        </h5>
        <el-form ref="list" :inline="true" :model="list3" label-width="130px">
            <el-row>
                <el-col :span="12">
                    <el-form-item label="性格特点">
                        <span class="spanToInput">{{list3.disposition | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="用户关注点">
                        <span class="spanToInput">{{list3.focus | userFocus}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="曾咨询医院">
                        <span class="spanToInput">{{list3.knowHospital | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="曾做过的医美项目">
                        <span class="spanToInput">{{list3.doneProject | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="经济自主权">
                        <span class="spanToInput">{{list3.economicAutonomy | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="经济实力">
                        <span class="spanToInput">{{list3.powerEconomic | filterNull}}</span>
                    </el-form-item>
                </el-col>
            </el-row>
        </el-form>
    </div>
</template>
<script>
    import { vipInfo } from '@/api/vipInfo' 
    export default {
        name:"vipInfo",
        data(){
            return {
                userId:"",
                list1:{},
                list2:[],
                list3:{}
            }
        },
        filters:{
            filterNull(e) {
                if(!e){
                    return "暂无"
                }else{
                    return e
                }
            },
            cardNull(e){
                return window.helper.cardType(e)
            },
            userFocus(e){
                return window.helper.userFocus(e)
            }
        },
        mounted(){
            this.userId = Number(this.$route.query.userId)
            this.getList()
        },
        methods:{
            getList(){
                let datas = {userId:this.userId}
                vipInfo(datas).then().then(res =>{
                    console.log(res)
                    if(!res.data.code){
                        if(res.data.data.user){
                            this.list1 = res.data.data.user
                        }
                        if(res.data.data.bankCard){
                            this.list2 = res.data.data.bankCard
                        }
                        if(res.data.data.userExtra){
                            this.list3 = res.data.data.userExtra
                        }
                    }else{
                        this.$message.error("数据接口访问失败");
                    }
                })
                .catch(error =>{
                    this.$message.error(error);
                })
            }
        }
    }
</script>

<style scoped>
    .app-container{padding: 0px!important}
    .form{margin-left: 268px}
</style>